<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统设置 - 朋知云学</title>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/admin.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@4.1.1/animate.min.css">
    <style>
        /* 系统设置页面特定样式 */
        .settings-container {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }
        
        .settings-sidebar {
            width: 250px;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            padding: 20px;
            flex-shrink: 0;
        }
        
        .settings-content {
            flex: 1;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            padding: 25px;
        }
        
        .settings-nav {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .settings-nav-item {
            padding: 12px 15px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 5px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .settings-nav-item:hover {
            background-color: #f8f9fa;
        }
        
        .settings-nav-item.active {
            background-color: #e3f2fd;
            color: #0d6efd;
        }
        
        .settings-nav-item i {
            font-size: 18px;
        }
        
        .settings-section {
            display: none;
        }
        
        .settings-section.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .settings-header {
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 1px solid #eee;
        }
        
        .settings-header h2 {
            margin: 0;
            color: #343a40;
        }
        
        .settings-header p {
            margin-top: 5px;
            color: #6c757d;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #343a40;
        }
        
        .form-control {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            font-size: 14px;
        }
        
        .form-control:focus {
            border-color: #80bdff;
            outline: 0;
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        }
        
        .form-text {
            font-size: 12px;
            color: #6c757d;
            margin-top: 5px;
        }
        
        .form-check {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .form-check-input {
            margin-right: 10px;
        }
        
        .settings-actions {
            margin-top: 30px;
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }
        
        .settings-card {
            border: 1px solid #eee;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
        }
        
        .settings-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .settings-card-title {
            font-size: 16px;
            font-weight: 500;
            margin: 0;
        }
        
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }
        
        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 24px;
        }
        
        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }
        
        input:checked + .toggle-slider {
            background-color: #2196F3;
        }
        
        input:checked + .toggle-slider:before {
            transform: translateX(26px);
        }
    </style>
</head>
<body>
    <!-- 页面加载动画 -->
    <div class="page-loader">
        <div class="loader"></div>
    </div>
    
    <!-- 管理员面板 -->
    <div class="admin-panel">朋知云学管理后台</div>
    
    <div class="admin-container">
        <!-- 侧边栏 -->
        <div class="admin-sidebar">
            <div class="admin-user">
                <div class="admin-user-info">
                    <div class="admin-username">管理员</div>
                    <div class="admin-role">超级管理员</div>
                </div>
            </div>
            
            <ul class="admin-sidebar-menu">
                <li class="admin-sidebar-item">
                    <a href="dashboard.html" class="admin-sidebar-link">
                        <i class="bi bi-speedometer2"></i>
                        <span>控制台</span>
                    </a>
                </li>
                <li class="admin-sidebar-item">
                    <a href="users.html" class="admin-sidebar-link">
                        <i class="bi bi-people"></i>
                        <span>用户管理</span>
                    </a>
                </li>
                <li class="admin-sidebar-item">
                    <a href="demands.html" class="admin-sidebar-link">
                        <i class="bi bi-list-check"></i>
                        <span>需求管理</span>
                    </a>
                </li>
                <li class="admin-sidebar-item">
                    <a href="applications.html" class="admin-sidebar-link">
                        <i class="bi bi-file-earmark-text"></i>
                        <span>申请审核</span>
                    </a>
                </li>
                <li class="admin-sidebar-item active">
                    <a href="settings.html" class="admin-sidebar-link">
                        <i class="bi bi-gear"></i>
                        <span>系统设置</span>
                    </a>
                </li>
                <li class="admin-sidebar-item">
                    <a href="../index.html" class="admin-sidebar-link">
                        <i class="bi bi-box-arrow-left"></i>
                        <span>返回前台</span>
                    </a>
                </li>
            </ul>
        </div>
        
        <!-- 主内容区 -->
        <div class="admin-content animate__animated animate__fadeIn">
            <div class="admin-header">
                <h1>系统设置</h1>
                <div class="admin-header-actions">
                    <div class="admin-notifications">
                        <i class="bi bi-bell"></i>
                        <span class="badge">3</span>
                    </div>
                </div>
            </div>
            
            <!-- 设置内容 -->
            <div class="settings-container">
                <!-- 设置侧边栏 -->
                <div class="settings-sidebar">
                    <ul class="settings-nav">
                        <li class="settings-nav-item active" data-target="general">
                            <i class="bi bi-sliders"></i>
                            <span>基本设置</span>
                        </li>
                        <li class="settings-nav-item" data-target="security">
                            <i class="bi bi-shield-lock"></i>
                            <a href="settings-security.html"><span>安全设置</span></a>
                        </li>
                        <li class="settings-nav-item" data-target="notification">
                            <i class="bi bi-bell"></i>
                            <a href="settings-notification.html"><span>通知设置</span></a>
                        </li>
                        <li class="settings-nav-item" data-target="appearance">
                            <i class="bi bi-palette"></i>
                            <a href="settings-appearance.html"><span>外观设置</span></a>
                        </li>
                        <li class="settings-nav-item" data-target="backup">
                            <i class="bi bi-cloud-arrow-up"></i>
                            <a href="settings-backup.html"><span>备份与恢复</span></a>
                        </li>
                        <li class="settings-nav-item" data-target="advanced">
                            <i class="bi bi-code-slash"></i>
                            <a href="settings-advanced.html"><span>高级设置</span></a>
                        </li>
                    </ul>
                </div>
                
                <!-- 设置内容区 -->
                <div class="settings-content">
                    <!-- 基本设置 -->
                    <div class="settings-section active" id="settings-general">
                        <div class="settings-header">
                            <h2>基本设置</h2>
                            <p>配置系统的基本信息和功能</p>
                        </div>
                        
                        <form id="general-settings-form" class="settings-form">
                            <div class="form-group">
                                <label for="site-name">网站名称</label>
                                <input type="text" id="site-name" class="form-control" value="朋知云学">
                            </div>
                            
                            <div class="form-group">
                                <label for="site-description">网站描述</label>
                                <textarea id="site-description" class="form-control" rows="3">朋知云学 - 让支教更简单</textarea>
                            </div>
                            
                            <div class="form-group">
                                <label for="admin-email">管理员邮箱</label>
                                <input type="email" id="admin-email" class="form-control" value="admin@pengzhi.com">
                                <div class="form-text">用于接收系统通知和用户反馈</div>
                            </div>
                            
                            <div class="form-group">
                                <label for="items-per-page">每页显示条目数</label>
                                <select id="items-per-page" class="form-control">
                                    <option>10</option>
                                    <option selected>20</option>
                                    <option>30</option>
                                    <option>50</option>
                                    <option>100</option>
                                </select>
                            </div>
                            
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">用户注册</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox" checked>
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>允许新用户注册账号</p>
                            </div>
                            
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">需求发布审核</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox" checked>
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>新发布的需求需要管理员审核后才能显示</p>
                            </div>
                            
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">维护模式</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox">
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>开启维护模式，网站将暂时关闭，只有管理员可以访问</p>
                            </div>
                            
                            <div class="settings-actions">
                                <button type="button" class="btn btn-secondary">重置</button>
                                <button type="submit" class="btn btn-primary">保存设置</button>
                            </div>
                        </form>
                    </div>
                    
                    <!-- 安全设置 -->
                    <div class="settings-section" id="settings-security">
                        <div class="settings-header">
                            <h2>安全设置</h2>
                            <p>配置系统的安全选项和访问控制</p>
                        </div>
                        
                        <form id="security-settings-form" class="settings-form">
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">双因素认证</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox">
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>为管理员账号启用双因素认证</p>
                            </div>
                            
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">登录尝试限制</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox" checked>
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>限制登录失败次数，防止暴力破解</p>
                            </div>
                            
                            <div class="form-group">
                                <label for="max-login-attempts">最大登录尝试次数</label>
                                <input type="number" id="max-login-attempts" class="form-control" value="5">
                            </div>
                            
                            <div class="form-group">
                                <label for="lockout-time">锁定时间（分钟）</label>
                                <input type="number" id="lockout-time" class="form-control" value="30">
                            </div>
                            
                            <div class="form-group">
                                <label for="password-policy">密码策略</label>
                                <select id="password-policy" class="form-control">
                                    <option>低（至少6个字符）</option>
                                    <option selected>中（至少8个字符，包含字母和数字）</option>
                                    <option>高（至少10个字符，包含大小写字母、数字和特殊字符）</option>
                                </select>
                            </div>
                            
                            <div class="form-group">
                                <label for="session-timeout">会话超时（分钟）</label>
                                <input type="number" id="session-timeout" class="form-control" value="60">
                                <div class="form-text">用户无操作后自动退出登录的时间</div>
                            </div>
                            
                            <div class="settings-actions">
                                <button type="button" class="btn btn-secondary">重置</button>
                                <button type="submit" class="btn btn-primary">保存设置</button>
                            </div>
                        </form>
                    </div>
                    
                    <!-- 通知设置 -->
                    <div class="settings-section" id="settings-notification">
                        <div class="settings-header">
                            <h2>通知设置</h2>
                            <p>配置系统的通知和提醒方式</p>
                        </div>
                        
                        <form id="notification-settings-form" class="settings-form">
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">邮件通知</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox" checked>
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>通过邮件发送系统通知</p>
                            </div>
                            
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">短信通知</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox">
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>通过短信发送系统通知</p>
                            </div>
                            
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">浏览器推送</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox" checked>
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>通过浏览器推送发送系统通知</p>
                            </div>
                            
                            <h3 class="mt-4 mb-3">通知事件</h3>
                            
                            <div class="form-check">
                                <input type="checkbox" id="notify-new-user" class="form-check-input" checked>
                                <label for="notify-new-user">新用户注册</label>
                            </div>
                            
                            <div class="form-check">
                                <input type="checkbox" id="notify-new-demand" class="form-check-input" checked>
                                <label for="notify-new-demand">新需求发布</label>
                            </div>
                            
                            <div class="form-check">
                                <input type="checkbox" id="notify-new-application" class="form-check-input" checked>
                                <label for="notify-new-application">新申请提交</label>
                            </div>
                            
                            <div class="form-check">
                                <input type="checkbox" id="notify-user-feedback" class="form-check-input" checked>
                                <label for="notify-user-feedback">用户反馈</label>
                            </div>
                            
                            <div class="form-check">
                                <input type="checkbox" id="notify-system-error" class="form-check-input" checked>
                                <label for="notify-system-error">系统错误</label>
                            </div>
                            
                            <div class="settings-actions">
                                <button type="button" class="btn btn-secondary">重置</button>
                                <button type="submit" class="btn btn-primary">保存设置</button>
                            </div>
                        </form>
                    </div>
                    
                    <!-- 外观设置 -->
                    <div class="settings-section" id="settings-appearance">
                        <div class="settings-header">
                            <h2>外观设置</h2>
                            <p>配置系统的界面和主题</p>
                        </div>
                        
                        <form id="appearance-settings-form" class="settings-form">
                            <div class="form-group">
                                <label for="theme">主题</label>
                                <select id="theme" class="form-control">
                                    <option selected>默认主题</option>
                                    <option>深色主题</option>
                                    <option>高对比度主题</option>
                                </select>
                            </div>
                            
                            <div class="form-group">
                                <label for="primary-color">主色调</label>
                                <input type="color" id="primary-color" class="form-control" value="#5bc0eb">
                            </div>
                            
                            <div class="form-group">
                                <label for="font-size">字体大小</label>
                                <select id="font-size" class="form-control">
                                    <option>小</option>
                                    <option selected>中</option>
                                    <option>大</option>
                                </select>
                            </div>
                            
                            <div class="form-group">
                                <label for="logo-upload">网站Logo</label>
                                <input type="file" id="logo-upload" class="form-control">
                                <div class="form-text">建议尺寸：200x50像素，支持PNG、JPG格式</div>
                            </div>
                            
                            <div class="form-group">
                                <label for="favicon-upload">网站图标</label>
                                <input type="file" id="favicon-upload" class="form-control">
                                <div class="form-text">建议尺寸：32x32像素，支持ICO、PNG格式</div>
                            </div>
                            
                            <div class="settings-card">
                                <div class="settings-card-header">
                                    <h3 class="settings-card-title">显示页脚</h3>
                                    <label class="toggle-switch">
                                        <input type="checkbox" checked>
                                        <span class="toggle-slider"></span>
                                    </label>
                                </div>
                                <p>在网站底部显示页脚信息</p>
                            </div>
                            
                            <div class="settings-actions">
                                <button type="button" class="btn btn-secondary">重置</button>
                                <button type="submit" class="btn btn-primary">保存设置</button>
                            </div>
                        </form>
                    </div>
                    
                    <!-- 备份与恢复 -->
                    <div class="settings-section" id="settings-backup">
                        <div class="settings-header">
                            <h2>备份与恢复</h2>
                            <p>管理系统数据的备份和恢复</p>
                        </div>
                        
                        <div class="settings-card">
                            <div class="settings-card-header">
                                <h3 class="settings-card-title">自动备份</h3>
                                <label class="toggle-switch">
                                    <input type="checkbox" checked>
                                    <span class="toggle-slider"></span>
                                </label>
                            </div>
                            <p>定期自动备份系统数据</p>
                        </div>
                        
                        <div class="form-group">
                            <label for="backup-frequency">备份频率</label>
                            <select id="backup-frequency" class="form-control">
                                <option>每天</option>
                                <option selected>每周</option>
                                <option>每月</option>
                            </select>
                        </div>
                        
                        <div class="form-group">
                            <label for="backup-retention">备份保留时间</label>
                            <select id="backup-retention" class="form-control">
                                <option>7天</option>
                                <option>14天</option>
                                <option selected>30天</option>
                                <option>90天</option>
                                <option>永久</option>
                            </select>
                        </div>
                        
                        <div class="form-group">
                            <label>备份内容</label>
                            <div class="form-check">
                                <input type="checkbox" id="backup-database" class="form-check-input" checked>
                                <label for="backup-database">数据库</label>
                            </div>
                            <div class="form-check">
                                <input type="checkbox" id="backup-files" class="form-check-input" checked>
                                <label for="backup-files">上传文件</label>
                            </div>
                            <div class="form-check">
                                <input type="checkbox" id="backup-settings" class="form-check-input" checked>
                                <label for="backup-settings">系统设置</label>
                            </div>
                        </div>
                        
                        <div class="mt-4">
                            <button type="button" class="btn btn-primary">
                                <i class="bi bi-download"></i> 立即备份
                            </button>
                        </div>
                        
                        <h3 class="mt-4 mb-3">恢复备份</h3>
                        
                        <div class="form-group">
                            <label for="restore-file">选择备份文件</label>
                            <input type="file" id="restore-file" class="form-control">
                        </div>
                        
                        <div class="mt-3">
                            <button type="button" class="btn btn-warning">
                                <i class="bi bi-arrow-counterclockwise"></i> 恢复系统
                            </button>
                        </div>
                    </div>
                    
                    <!-- 高级设置 -->
                    <div class="settings-section" id="settings-advanced">
                        <div class="settings-header">
                            <h2>高级设置</h2>
                            <p>配置系统的高级选项和功能</p>
                        </div>
                        
                        <div class="alert alert-warning">
                            <i class="bi bi-exclamation-triangle"></i>
                            警告：这些设置可能会影响系统的稳定性和性能，请谨慎修改。
                        </div>
                        
                        <div class="settings-card">
                            <div class="settings-card-header">
                                <h3 class="settings-card-title">开发者模式</h3>
                                <label class="toggle-switch">
                                    <input type="checkbox">
                                    <span class="toggle-slider"></span>
                                </label>
                            </div>
                            <p>启用开发者模式，显示详细的错误信息和调试工具</p>
                        </div>
                        
                        <div class="settings-card">
                            <div class="settings-card-header">
                                <h3 class="settings-card-title">缓存</h3>
                                <label class="toggle-switch">
                                    <input type="checkbox" checked>
                                    <span class="toggle-slider"></span>
                                </label>
                            </div>
                            <p>启用系统缓存，提高性能</p>
                        </div>
                        
                        <div class="form-group">
                            <label for="cache-lifetime">缓存生命周期（分钟）</label>
                            <input type="number" id="cache-lifetime" class="form-control" value="60">
                        </div>
                        
                        <div class="mt-3 mb-4">
                            <button type="button" class="btn btn-secondary">
                                <i class="bi bi-trash"></i> 清除缓存
                            </button>
                        </div>
                        
                        <div class="form-group">
                            <label for="api-key">API密钥</label>
                            <div class="input-group">
                                <input type="text" id="